<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <!--[if lt IE 9]>
  <script type="text/javascript" src="__EXTEND__/lib/html5shiv.js"></script>
  <script type="text/javascript" src="__EXTEND__/lib/respond.min.js"></script>
  <![endif]-->
  <link href="__EXTEND__/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
  <link href="__EXTEND__/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" type="text/css" />
  <link href="__EXTEND__/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
  <link href="__EXTEND__/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
  <!--[if IE 6]>
  <script type="text/javascript" src="__EXTEND__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
  <script>DD_belatedPNG.fix('*');</script>
  <![endif]-->
  <title>湖州交警支队在线审批-后台登录</title>
  <meta name="keywords" content="">
  <meta name="description" content="">
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />
<div class="header">
  <h1 style="font-size:24px; margin:auto 10px; padding:inherit; line-height:50px;color:white"></h1>
</div>
<div class="loginWraper">
  <div id="loginform" class="loginBox">
    <form id="form_login" class="form form-horizontal" action="{{:U('Admin/Public/login')}}" method="post">
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-xs-8">
          <input id="username" name="username" type="text" placeholder="用户名" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-xs-8">
          <input id="password" name="password" type="password" placeholder="密码" class="input-text size-L">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-xs-3">验证码:</label>
        <div class="formControls col-xs-8 ">
          <input name="verify" class="input-text size-L" type="text" placeholder="验证码" onblur="if(this.value==''){this.value=''}" onclick="if(this.value=='验证码:'){this.value='';}"  style="width:150px;">
          <!--<img src="">-->
          <a href="javascript:void(0);" class="">
            <img class="verifyimg reloadverify" alt="点击切换" src="{{:U('Admin/Public/verify')}}" style="width:100px;height:41px;padding-bottom:3px">
          </a>
        </div>
      </div>
      <!--<div class="row cl">-->
      <!--<div class="formControls col-xs-8 col-xs-offset-3">-->
      <!--<label for="online">-->
      <!--<input type="checkbox" name="online" id="online" value="">-->
      <!--使我保持登录状态</label>-->
      <!--</div>-->
      <!--</div>-->
      <div class="row cl">
        <div class="formControls col-xs-8 col-xs-offset-3">
          <span id="wait_img" style="display:none"><img style="width:31px;" src="__PUBLIC__/default/loading-1.gif"></span>
          <input name="" id="submit" type="submit" class="btn btn-primary radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
          <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
      <div class="check-tips" style="color:darkred;font-weight: bold;text-align:center"></div>
    </form>
  </div>
</div>
<div class="footer">Copyright 宝箱荷包</div>
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/jquery-1.10.2.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<!--<![endif]-->

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__EXTEND__/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer /作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__EXTEND__/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript">
    $(function(){

        //表单验证
        $("#form_login").validate({
            rules: {
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid",
            submitHandler: function (form) {
                $("form").ajaxSubmit({
                    type: 'post',
                    url: "{{:U('Admin/Public/login')}}",
                    beforeSend:function(){
                        $(".check-tips").text("");
                        $('#submit').hide();
                        $('#wait_img').show();
                    },
                    success: function (data) {
                        $('#wait_img').hide();
                        $('#submit').show();
                        if(data.status){
                            layer.msg("登录成功",{time:500});
                            setTimeout((function() {
                                window.location.href = "{{:U('Admin/Index/index')}}";
                            }), 500);
                        } else {
                            $(".check-tips").text(data.info);

                            //刷新验证码
                            $(".reloadverify").click();
                            $("input[name='verify']").val("");
                        }
                    },
                    error: function (XmlHttpRequest, textStatus, errorThrown) {
                        layer.msg('error!', {icon: 5, time: 1000});
                    }
                });
            }
        });

        //初始化选中用户名输入框
        $("#itemBox").find("input[name=username]").focus();
        //刷新验证码
        var verifyimg = $(".verifyimg").attr("src");
        $(".reloadverify").click(function(){
            if( verifyimg.indexOf('?')>0){
                $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
            }else{
                $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
            }
        });

        //placeholder兼容性
        //如果支持
        function isPlaceholer(){
            var input = document.createElement('input');
            return "placeholder" in input;
        }
        //如果不支持
        if(!isPlaceholer()){
            $(".placeholder_copy").css({
                display:'block'
            })
            $("#itemBox input").keydown(function(){
                $(this).parents(".item").next(".placeholder_copy").css({
                    display:'none'
                })
            })
            $("#itemBox input").blur(function(){
                if($(this).val()==""){
                    $(this).parents(".item").next(".placeholder_copy").css({
                        display:'block'
                    })
                }
            })


        }
    });
</script>

</body>
</html>